package com.greenline.push.dal.pushcenter.impl;

import com.greenline.push.dal.base.BaseDAO;
import com.greenline.push.dal.pushcenter.ClassMessageDAO;
import com.greenline.push.dal.pushcenter.dataobject.ClassMessageDO;
import com.greenline.push.dal.query.ClassMessageQuery;

public class ClassMessageDAOImpl extends BaseDAO implements ClassMessageDAO {

	@Override
	public Long insert(ClassMessageDO msgDO) {
		return (Long) super.getSqlMapClientTemplate().insert(
				"classMessage.insert", msgDO);
	}

	@Override
	public ClassMessageDO getClassMessageById(Long id) {
		return (ClassMessageDO) super.getSqlMapClientTemplate().queryForObject(
				"classMessage.find_by_id", id);
	}

	@Override
	public int update(ClassMessageDO msgDO) {
		return super.getSqlMapClientTemplate().update("classMessage.update",
				msgDO);
	}

	@Override
	public ClassMessageQuery listByQuery(ClassMessageQuery query) {
		return (ClassMessageQuery) super.listByQuery(
				"classMessage.list_by_query", query);
	}

	@Override
	public int delete(Long id) {
		return super.getSqlMapClientTemplate()
				.delete("classMessage.delete", id);
	}

}
